<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * 绑定记录表
 * 用来记录userid与workmain的临时id绑定关系
 * Class BindingRecord
 * @package App\Models
 */
class BindingRecord extends Model
{
    use SoftDeletes;

    protected $guarded = [];

    //绑定记录一对多关联聊天记录
    public function chatRecordsHasMany()
    {
        return $this->hasMany(ChatRecords::class,'sender_id','id');
    }

    //1v1关联用户
    public function user()
    {
        return $this->hasOne(User::class,'id','user_id');
    }

}
